package com.gdk.service.impl;

import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gdk.dao.LoginDao;
import com.gdk.service.LoginService;
import com.gdk.utils.Md5Utils;


/**
 * 业务处理
 * */
@Service("LoginService")
public class LoginServiceImpl implements LoginService {
	@Autowired
    private LoginDao loginDao;

	 /**
	  * 查询管理员信息
	  * */
	 @Override
	public Map<String, Object> doFindRootDetails(Map<String, Object> map) {
		 //将密码进行md5加密
		String pwd = Md5Utils.md5( map.get("password").toString());
		System.out.println("加密后  : "+pwd);
		
		map.put("password", pwd);
		 Map<String, Object> rootDetails = loginDao.findRootDetails(map);
		 return rootDetails;
	}
	 @Override
	public int doUpdateLoginRootDetails(Map<String, Object> map) {
		return loginDao.updateLoginRootDetails(map);
	}

}
